from ape import accounts, project, networks
import os

def main():
    with networks.ethereum.local.use_provider("hardhat"):

        # 使用默认账户进行部署
        try:
            account = accounts.load("account_1")
            print(f"Loaded account: {account}")
        except KeyError as e:
            print(f"Error loading account: {e}")
            return

        # 部署 RandomNumber 合约
        random_number = account.deploy(project.RandomNumber)
        print("RandomNumber deployed to:", random_number.address)

        # 部署其他合约...
        # 省略其他合约部署代码

if __name__ == "__main__":
    main()